From 88c57dd967e420d49199c1986e72502a7dcf18b0 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Mon, 18 Dec 2006 17:23:25 +0000 Subject: [PATCH] * (bug 2785) Accept optional colon prefix in links when formatting comments --- RELEASE-NOTES | 1 + includes/Linker.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6d1d114aec..f24d47c97e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -341,6 +341,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 8110) Make magic ISBN linking stricter: only match ten-digit sequences (plus optional ISBN-13 prefix) with no immediately following alphanumeric character, disallow multiple consecutive internal redirects +* (bug 2785) Accept optional colon prefix in links when formatting comments == Languages updated == diff --git a/includes/Linker.php b/includes/Linker.php index b3a24e1bdb..ad2f098bf2 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -912,7 +912,7 @@ class Linker { # is ignored $medians = '(?:' . preg_quote( Namespace::getCanonicalName( NS_MEDIA ), '/' ) . '|'; $medians .= preg_quote( $wgContLang->getNsText( NS_MEDIA ), '/' ) . '):'; - while(preg_match('/\[\[(.*?)(\|(.*?))*\]\](.*)$/',$comment,$match)) { + while(preg_match('/\[\[:?(.*?)(\|(.*?))*\]\](.*)$/',$comment,$match)) { # Handle link renaming [[foo|text]] will show link as "text" if( "" != $match[3] ) { $text = $match[3]; -- 2.20.1